package com.galaxy.device.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.device.domain.vo.OrderCouponVo;
import com.galaxy.device.domain.vo.OrderDetailVo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单对象 order
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("`order`")
public class Order extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;
    private String orderNo;
    private Long userId;
    private Long deviceId;
    private BigDecimal totalAmount;
    private BigDecimal actualAmount;
    private BigDecimal discountAmount;
    private Integer payType;
    private LocalDateTime payTime;
    private Integer status;
    private String outTradeNo;
    private LocalDateTime completeTime;
    private LocalDateTime cancelTime;
    private String cancelReason;
    private String remark;
    private String tenantId;

    @TableField(exist = false)
    private List<OrderDetailVo> orderDetail;

    @TableField(exist = false)
    private OrderCouponVo orderCoupon;

    @TableField(exist = false)
    private String payTypeName;

    @TableField(exist = false)
    private String statusName;
}
